import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/Home',
    name: 'Home',
    component: () => import('../views/Home.vue'),
    children: [
      {
        path: '/index',
        name: 'Index',
        component: () => import('@/components/home/Index.vue')
      },
      {
        path: '/news',
        name: 'News',
        component: () => import('@/components/home/News.vue')
      },
      {
        path: '/my',
        name: 'My',
        component: () => import('@/components/home/My.vue')
      },
      {
        path: '/home',
        redirect: '/index'
      }
    ]
  },
  {
    path: '/',
    redirect: '/home'
  }
]

const router = new VueRouter({
  routes
})

export default router
